package homework;

import java.io.File;
import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        System.out.println("请输入要删除的目录");
        Scanner sc=new Scanner(System.in);
        while (true) {
            String s = sc.nextLine();
            File file = new File("./" + s);
            if (file.exists()){
                file.delete();
                System.out.println("删除成功");
                break;
            }else {
                System.out.println("不存在该目录，请重新输入");
            }
        }
    }
}
